﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace carinfor
{
    public class equipmentConfigInfdata
    {
        public string EISID { set; get; }
        private string cgjck;

        public string Cgjck
        {
            get { return cgjck; }
            set { cgjck = value; }
        }
        
        private string ledck;

        public string Ledck
        {
            get { return ledck; }
            set { ledck = value; }
        }
        
        private bool cgjifpz;

        public bool Cgjifpz
        {
            get { return cgjifpz; }
            set { cgjifpz = value; }
        }
        
        private bool ledifpz;

        public bool Ledifpz
        {
            get { return ledifpz; }
            set { ledifpz = value; }
        }
        private string cgjxh;

        public string Cgjxh
        {
            get { return cgjxh; }
            set { cgjxh = value; }
        }
        
        private int emergencyStop;

        public int EmergencyStop
        {
            get { return emergencyStop; }
            set { emergencyStop = value; }
        }
        private int heatFan;

        public int HeatFan
        {
            get { return heatFan; }
            set { heatFan = value; }
        }
        private string displayMethod;

        public string DisplayMethod
        {
            get { return displayMethod; }
            set { displayMethod = value; }
        }
        private int mainDislpay;

        public int MainDislpay
        {
            get { return mainDislpay; }
            set { mainDislpay = value; }
        }
        private int driverDisplay;

        public int DriverDisplay
        {
            get { return driverDisplay; }
            set { driverDisplay = value; }
        }
        
        public int DriverFbl { set; get; }
        private string ledxh;

        public string Ledxh
        {
            get { return ledxh; }
            set { ledxh = value; }
        }
        private string ledComstring;

        public string LedComstring
        {
            get { return ledComstring; }
            set { ledComstring = value; }
        }
        public int CGJR { set; get; }
        public string cgjckpzz { set; get; }
        
        private int _BrakePWM;
        public int BrakePWM
        {
            get
            {
                return _BrakePWM;
            }

            set
            {
                _BrakePWM = value;
            }

        }
        
        public int ledrow1 { set; get; }
        public int ledrow2 { set; get; }
        public int LEDTJPH { set; get; }
        
        public string igbtVersion { set; get; }
        
        public int eddycount { set; get; }
        public int forceFull { set; get; }
        public double forceRatio { set; get; }
        public int OBDTimeLimit { set; get; }


        public int bpqcontrolmode { set; get; }
        public string bpqcom { set; get; }
        public string bpqcompz { set; get; }
        public string bpqxh { set; get; }
        public double bpqxs { set; get; }

        public string servoXH { set; get; }
        /// <summary>
        /// 0-PC485控制  1-MCU485控制
        /// </summary>
        public int servocontrolmode { set; get; }
        public string servocom { set; get; }
        public string servocompz { set; get; }
        public int servoRelay { set; get; }
        public int servoLockRelay { set; get; }
        public int servoUnLockRelay { set; get; }
        public int evRelayTime { set; get; }
        public int servoStartDistance { set; get; }
        public int servoEndDistance { set; get; }
        public int liftUpRelay { set; get; }
        public int liftDownRelay { set; get; }

        public string EVChargeXH { set; get; }
        public string EVChargeIP { set; get; }
        public string EVChargePort { set; get; }

        public string EVOBDXH { set; get; }
        public string EVOBDIP { set; get; }
        public string EVOBDPort { set; get; }





        public equipmentConfigInfdata CopyFrom(equipmentConfigInfdata other)
        {
            // 使用循环逐个复制属性值
            var newA = new equipmentConfigInfdata();
            newA.EISID = other.EISID;
            newA.Cgjck = other.Cgjck;
            newA.Ledck = other.Ledck;
            newA.Ledifpz = other.Ledifpz;
            newA.Cgjxh = other.Cgjxh;
            newA.EmergencyStop = other.EmergencyStop;
            newA.HeatFan = other.HeatFan;
            newA.DisplayMethod = other.DisplayMethod;
            newA.MainDislpay = other.MainDislpay;
            newA.DriverDisplay = other.DriverDisplay;
            newA.DriverFbl = other.DriverFbl;
            newA.Ledxh = other.Ledxh;
            newA.LedComstring = other.LedComstring;
            newA.cgjckpzz = other.cgjckpzz;
            newA.BrakePWM = other.BrakePWM;
            newA.ledrow1 = other.ledrow1;
            newA.ledrow2 = other.ledrow2;
            newA.LEDTJPH = other.LEDTJPH;
            newA.igbtVersion = other.igbtVersion;
            newA.eddycount = other.eddycount;
            newA.forceFull = other.forceFull;
            newA.forceRatio = other.forceRatio;
            newA.OBDTimeLimit = other.OBDTimeLimit;

            newA.CGJR = other.CGJR;


            newA.bpqcontrolmode = other.bpqcontrolmode;
            newA.bpqxh = other.bpqxh;
            newA.bpqcom = other.bpqcom;
            newA.bpqcompz = other.bpqcompz;
            newA.bpqxs = other.bpqxs;

            newA.servoXH = other.servoXH;
            newA.servocontrolmode = other.servocontrolmode;
            newA.servocom = other.servocom;
            newA.servocompz = other.servocompz;
            newA.servoRelay = other.servoRelay;
            newA.servoLockRelay = other.servoLockRelay;
            newA.servoUnLockRelay = other.servoUnLockRelay;
            newA.servoStartDistance = other.servoStartDistance;
            newA.servoEndDistance = other.servoEndDistance;
            newA.liftUpRelay = other.liftUpRelay;
            newA.liftDownRelay = other.liftDownRelay;
            newA.evRelayTime = other.evRelayTime;

            newA.EVChargeXH = other.EVChargeXH;
            newA.EVChargeIP = other.EVChargeIP;
            newA.EVChargePort = other.EVChargePort;
            newA.EVOBDXH = other.EVOBDXH;
            newA.EVOBDIP = other.EVOBDIP;
            newA.EVOBDPort = other.EVOBDPort;
            //newA.caculate_vibrationForce = other.caculate_vibrationForce;
            // 复制其他属性值
            // newA.a3 = other.a3;
            // ...

            return newA;
        }
    }
   
    public class configIni
    {
        public string startUpPath = "D:/环检配置文件";
        public equipmentConfigInfdata getEquipConfigIni()
        {
            float a = 0;
            int b = 0;
            double c = 0;
            equipmentConfigInfdata configinidata = new equipmentConfigInfdata();
            StringBuilder temp = new StringBuilder();
            temp.Length = 2048;

            Log.INIIO.GetPrivateProfileString("东软联网", "EISID", "0000000049", temp, 2048, @"D:\环检配置文件\appConfig.ini");
            configinidata.EISID = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "测功机串口", "COM1/DCG-10B|DCG-10C|DCG-10XJ", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.Cgjck = temp.ToString().Trim().Split('/')[0];
            configinidata.Cgjxh = temp.ToString().Trim().Split('/')[1];
            Log.INIIO.GetPrivateProfileString("配置参数", "LED串口", "", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.Ledck = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "LED型号", "仰邦", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.Ledxh = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "LED串口配置字", "9600,N,8,1", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.LedComstring = temp.ToString().Trim();

            Log.INIIO.GetPrivateProfileString("配置参数", "测功机", "", temp, 2048, startUpPath + "/detectConfig.ini");
            if (temp.ToString().Trim() == "true")
                configinidata.Cgjifpz = true;
            else
                configinidata.Cgjifpz = false;
            Log.INIIO.GetPrivateProfileString("配置参数", "LED屏", "", temp, 2048, startUpPath + "/detectConfig.ini");
            if (temp.ToString().Trim() == "true")
                configinidata.Ledifpz = true;
            else
                configinidata.Ledifpz = false;
            
            Log.INIIO.GetPrivateProfileString("配置参数", "散热风扇", "2", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.HeatFan = int.Parse(temp.ToString());
            }
            catch
            {
                configinidata.HeatFan = 2;
            }
            Log.INIIO.GetPrivateProfileString("配置参数", "紧急停止", "1", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.EmergencyStop = int.Parse(temp.ToString());
            }
            catch
            {
                configinidata.EmergencyStop = 1;
            }

            Log.INIIO.GetPrivateProfileString("配置参数", "显示方式", "", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.DisplayMethod = temp.ToString();
            Log.INIIO.GetPrivateProfileString("配置参数", "主显示", "0", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.MainDislpay = int.Parse(temp.ToString());
            }
            catch
            {
                configinidata.MainDislpay = 0;
            }
            Log.INIIO.GetPrivateProfileString("配置参数", "司机助", "1", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.DriverDisplay = int.Parse(temp.ToString());
            }
            catch
            {
                configinidata.DriverDisplay = 1;
            }
            Log.INIIO.GetPrivateProfileString("配置参数", "司机助分辨率", "0", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.DriverFbl = int.Parse(temp.ToString());
            }
            catch
            {
                configinidata.DriverFbl = 0;
            }
            Log.INIIO.GetPrivateProfileString("配置参数", "测功机串口配置字", "38400,N,8,1", temp, 2048, startUpPath + "/detectConfig.ini");
            if (temp.ToString() == "") configinidata.cgjckpzz = "38400,N,8,1";
            else
                configinidata.cgjckpzz = temp.ToString();
            
            Log.INIIO.GetPrivateProfileString("配置参数", "刹车占空比", "15", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.BrakePWM = int.Parse(temp.ToString());
            }
            catch
            {
                configinidata.BrakePWM = 15;
            }
            
            Log.INIIO.GetPrivateProfileString("配置参数", "LEDROW1", "0", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.ledrow1 = int.Parse(temp.ToString());
            }
            catch
            {
                configinidata.ledrow1 = 0;
            }

            Log.INIIO.GetPrivateProfileString("配置参数", "LEDROW2", "1", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.ledrow2 = int.Parse(temp.ToString());
            }
            catch
            {
                configinidata.ledrow2 = 2;
            }
            Log.INIIO.GetPrivateProfileString("配置参数", "LEDTJPH", "1", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.LEDTJPH = int.Parse(temp.ToString());
            }
            catch
            {
                configinidata.LEDTJPH = 2;
            }
            
            Log.INIIO.GetPrivateProfileString("配置参数", "控制器型号", "v7.1", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.igbtVersion = temp.ToString();
            
            Log.INIIO.GetPrivateProfileString("配置参数", "eddycount", "1", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.eddycount = int.Parse(temp.ToString());
            }
            catch
            {
                configinidata.eddycount = 0;
            }
            Log.INIIO.GetPrivateProfileString("配置参数", "forceFull", "8000", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.forceFull = int.Parse(temp.ToString());
            }
            catch
            {
                configinidata.forceFull = 80;
            }
            Log.INIIO.GetPrivateProfileString("配置参数", "forceRatio", "10", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.forceRatio = double.Parse(temp.ToString());
            }
            catch
            {
                configinidata.forceRatio = 10;
            }
            Log.INIIO.GetPrivateProfileString("配置参数", "OBDTimeLimit", "10", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.OBDTimeLimit = int.Parse(temp.ToString());
            }
            catch
            {
                configinidata.OBDTimeLimit = 10;
            }


            Log.INIIO.GetPrivateProfileString("配置参数", "bpqcontrolmode", "0", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.bpqcontrolmode = int.Parse(temp.ToString().Trim());
            Log.INIIO.GetPrivateProfileString("配置参数", "bpqcom", "COM1", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.bpqcom = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "bpqcompz", "9600,N,8,1", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.bpqcompz = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "bpqxh", "BML", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.bpqxh = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "bpqxs", "0.82", temp, 2048, startUpPath + "/detectConfig.ini");          //读配置文件（段名，字段，默认值，保存的strbuilder，大小，路径）
            try
            {
                configinidata.bpqxs = double.Parse(temp.ToString());
            }
            catch
            {
                configinidata.bpqxs = 0.82;
            }

            Log.INIIO.GetPrivateProfileString("配置参数", "servoXH", "无", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.servoXH = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "servocontrolmode", "0", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.servocontrolmode = int.Parse(temp.ToString().Trim());
            Log.INIIO.GetPrivateProfileString("配置参数", "servocom", "COM1", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.servocom = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "servocompz", "9600,N,8,2", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.servocompz = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "servoRelay", "4", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.servoRelay = int.Parse(temp.ToString().Trim());
            Log.INIIO.GetPrivateProfileString("配置参数", "servoLockRelay", "5", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.servoLockRelay = int.Parse(temp.ToString().Trim());
            Log.INIIO.GetPrivateProfileString("配置参数", "servoUnLockRelay", "6", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.servoUnLockRelay = int.Parse(temp.ToString().Trim());
            Log.INIIO.GetPrivateProfileString("配置参数", "liftUpRelay", "1", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.liftUpRelay = int.Parse(temp.ToString().Trim());
            Log.INIIO.GetPrivateProfileString("配置参数", "liftDownRelay", "2", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.liftDownRelay = int.Parse(temp.ToString().Trim());
            Log.INIIO.GetPrivateProfileString("配置参数", "servoStartDistance", "1920", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.servoStartDistance = int.Parse(temp.ToString().Trim());
            Log.INIIO.GetPrivateProfileString("配置参数", "servoEndDistance", "3420", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.servoEndDistance = int.Parse(temp.ToString().Trim());
            Log.INIIO.GetPrivateProfileString("配置参数", "evRelayTime", "1000", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.evRelayTime = int.Parse(temp.ToString().Trim());


            Log.INIIO.GetPrivateProfileString("配置参数", "EVChargeXH", "无", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.EVChargeXH = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "EVChargeIP", "127.0.0.1", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.EVChargeIP = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "EVChargePort", "10055", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.EVChargePort = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "EVOBDXH", "无", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.EVOBDXH = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "EVOBDIP", "127.0.0.1", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.EVOBDIP = temp.ToString().Trim();
            Log.INIIO.GetPrivateProfileString("配置参数", "EVOBDPort", "10056", temp, 2048, startUpPath + "/detectConfig.ini");
            configinidata.EVOBDPort = temp.ToString().Trim();
            return configinidata;
        }
        public bool writeEquipmentConfig(equipmentConfigInfdata equipconfig)
        {
            try
            {
                Log.INIIO.WritePrivateProfileString("配置参数", "测功机串口", equipconfig.Cgjck + "/" + equipconfig.Cgjxh, startUpPath + "/detectConfig.ini");
                
                Log.INIIO.WritePrivateProfileString("配置参数", "刹车占空比", equipconfig.BrakePWM.ToString(), startUpPath + "/detectConfig.ini");
                
                Log.INIIO.WritePrivateProfileString("配置参数", "测功机串口配置字", equipconfig.cgjckpzz, startUpPath + "/detectConfig.ini");
                
                Log.INIIO.WritePrivateProfileString("配置参数", "LED串口", equipconfig.Ledck.ToString(), startUpPath + "/detectConfig.ini");
                
                Log.INIIO.WritePrivateProfileString("配置参数", "LED型号", equipconfig.Ledxh.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "LED串口配置字", equipconfig.LedComstring.ToString(), startUpPath + "/detectConfig.ini");
                
                Log.INIIO.WritePrivateProfileString("配置参数", "测功机", equipconfig.Cgjifpz.ToString().ToLower(), startUpPath + "/detectConfig.ini");
                
                Log.INIIO.WritePrivateProfileString("配置参数", "散热风扇", equipconfig.HeatFan.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "紧急停止", equipconfig.EmergencyStop.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "显示方式", equipconfig.DisplayMethod.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "司机助", equipconfig.DriverDisplay.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "司机助分辨率", equipconfig.DriverFbl.ToString(), startUpPath + "/detectConfig.ini");
                
                Log.INIIO.WritePrivateProfileString("配置参数", "LEDROW1", equipconfig.ledrow1.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "LEDROW2", equipconfig.ledrow2.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "LEDTJPH", equipconfig.LEDTJPH.ToString(), startUpPath + "/detectConfig.ini");
                
                Log.INIIO.WritePrivateProfileString("配置参数", "控制器型号", equipconfig.igbtVersion, startUpPath + "/detectConfig.ini");
                
                Log.INIIO.WritePrivateProfileString("配置参数", "eddycount", equipconfig.eddycount.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "forceFull", equipconfig.forceFull.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "forceRatio", equipconfig.forceRatio.ToString("0.0"), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "OBDTimeLimit", equipconfig.OBDTimeLimit.ToString(), startUpPath + "/detectConfig.ini");


                Log.INIIO.WritePrivateProfileString("配置参数", "bpqcontrolmode", equipconfig.bpqcontrolmode.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "bpqcom", equipconfig.bpqcom, startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "bpqcompz", equipconfig.bpqcompz, startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "bpqxh", equipconfig.bpqxh, startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "bpqxs", equipconfig.bpqxs.ToString("0.000"), startUpPath + "/detectConfig.ini");

                Log.INIIO.WritePrivateProfileString("配置参数", "servoXH", equipconfig.servoXH, startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "servocontrolmode", equipconfig.servocontrolmode.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "servocom", equipconfig.servocom, startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "servocompz", equipconfig.servocompz, startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "servoRelay", equipconfig.servoRelay.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "servoLockRelay", equipconfig.servoLockRelay.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "servoUnLockRelay", equipconfig.servoUnLockRelay.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "servoStartDistance", equipconfig.servoStartDistance.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "servoEndDistance", equipconfig.servoEndDistance.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "liftUpRelay", equipconfig.liftUpRelay.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "liftDownRelay", equipconfig.liftDownRelay.ToString(), startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "evRelayTime", equipconfig.evRelayTime.ToString(), startUpPath + "/detectConfig.ini");

                Log.INIIO.WritePrivateProfileString("配置参数", "EVChargeXH", equipconfig.EVChargeXH, startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "EVChargeIP", equipconfig.EVChargeIP, startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "EVChargePort", equipconfig.EVChargePort, startUpPath + "/detectConfig.ini");

                Log.INIIO.WritePrivateProfileString("配置参数", "EVOBDXH", equipconfig.EVOBDXH, startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "EVOBDIP", equipconfig.EVOBDIP, startUpPath + "/detectConfig.ini");
                Log.INIIO.WritePrivateProfileString("配置参数", "EVOBDPort", equipconfig.EVOBDPort, startUpPath + "/detectConfig.ini");
                return true;
            }
            catch
            {
                return false;
            }
        }
    }
}
